package com.chexiang360.service;

import com.chexiang360.mapper.GoodsMapper;
import com.chexiang360.model.GoodsModel;
import com.chexiang360.util.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class GoodsService {


    @Autowired
    GoodsMapper goodsMapper;

    public PageUtil<GoodsModel> goodsList(PageUtil<GoodsModel> pu, Map<String, Object> map) {
        pu.pageUtilHandle(goodsMapper.getGoodsListCount(map));
        map.put("startRow", pu.getStartRow());
        map.put("pageSize", pu.getPageSize());
        pu.setDataList(goodsMapper.goodsList(map));
        return pu;
    }
}
